lib: Coerce flags enums to GIR bitfields
authorDan Nicholson <nicholson@endlessm.com>
Thu, 30 Apr 2020 20:28:20 +0000 (14:28 -0600)
committerDan Nicholson <nicholson@endlessm.com>
Thu, 30 Apr 2020 21:13:31 +0000 (15:13 -0600)
commitdc69f56de6dab66f7bb4fe66aa203e84efa9676c
treee99e81915b631d8b7dc4d218e3f29c5f12a01e58
parent240f6d3ac61276011014c7bcc855f21901026c66
lib: Coerce flags enums to GIR bitfields

The GI scanner decides if an `enum` is really a `bitfield` if it finds
any values that have left shifts. With an `enumeration`, the
introspecting language may error or convert to a different type if the
user tries to combine values. Change all Flags `enum`s to use
left-shifted values so that they're represented as `bitfield`s in the
GIR.

The primary bug here is that you can't combine `REFS_ONLY` and
`NO_PRUNE` when calling `OSTree.Repo.prune()` from an introspected
language.

This is an IABI break since the typelib will change from `enumeration`
to `bitfield`. `OstreeRepoImportFlags` is internal but the change is
included here to prepare for a subsequent name that would require bit
shifting to operate correctly as a flag.
src/libostree/ostree-gpg-verify-result.h
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.h